import api from '../../../fetch/api'

export default {
    data() {
        return {
            bigImgPath: ''
        }
    },
    created() {
        
    },
    methods: {
        getList() {
            this.getItemList(this.searchParams);
        },
        showBigImgModal(name, path) {
            this.bigImgPath = path;
            this.toOpenImgModal(name, path);
        },
        //获取列表
        getItemList(aparams) {
            let self = this,
                params = {
                    page: this.pageNumber,
                    rp: this.pageSize
                };
            params = $.extend({}, params, self.otherParams, aparams);
            api.fetchGet('/coupon/getCouponGrantList.do', params)
                .then(res => {
                    let data = res.data,
                        list = data.rows;
                    self.tbodysInfo = list;
                    self.total = data.total;
                }, err => { })
        },
        exportData() {
            let self = this;
            let theadsArr = []
            for(let i = 0; i<self.theadsInfo.length; i++){
            if(self.theadsInfo[i].checked){
                theadsArr.push(self.theadsInfo[i].prop)
            }
            }
            let params = {
                meterList: theadsArr.join(',')
            };
            params = $.extend({}, params, this.otherParams, this.searchParams);
            self.showDialog("确认导出该报表?", '', function () {
                self.toExportAsync('coupon/exportCouponGrantList.do', params);
            })
        }
    }
}